package com.llcbenwu.social;

import org.springframework.social.security.SocialAuthenticationFilter;
import org.springframework.social.security.SpringSocialConfigurer;

/**
 * @author lilinchun
 * @date 2021/11/2 0002 19:07
 */
public class LlcSpringSocialConfig extends SpringSocialConfigurer {



    private String filterProcessesUrl;


    public LlcSpringSocialConfig(String filterProcessesUrl){
        this.filterProcessesUrl=filterProcessesUrl;
    }

    @Override
    protected <T> T postProcess(T object) {
        //在父类处理完SocialAuthenticationFilter之后的基础上，将其默认拦截url改成我们配置的值
        SocialAuthenticationFilter socialAuthenticationFilter= (SocialAuthenticationFilter) super.postProcess(object);
        socialAuthenticationFilter.setFilterProcessesUrl(filterProcessesUrl);
        return  super.postProcess(object);
    }

}
